
angular.module('App')

.factory('AppService', ['$q','$http', '$filter', function($q, $http, $filter) {
    return {
        getCompletePlanByDate: getCompletePlanByDate,
        
        
    };

    //获取完工计划数据
    function getCompletePlanByDate (CompleteDate) { 
        return http({
            method: 'POST',
            url: '/api/CompletePlan/getCompletePlanByDate',
            data: {
                CompleteDate: CompleteDate      
            }
        });
    }

    

    function http (cfg) { 
        var deferred = $q.defer();

        $http(cfg).success(function(result) {
            if (result.Data) {
                deferred.resolve(result.Data);
            } else {
                deferred.reject(result.Error);
            }
        }).error(function(err) {
            deferred.reject(err);
        });

        return deferred.promise;
    }
}]);